<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const goods = {
      name: 'mate',
      price:680,
      address:'深圳',
      pay:(x)=>{
          console.log(x)
      }
    }
    // goods.dance=function(x){
    //   console.log('跳舞')
    // }
    // goods.dance(1)
    // 改值
    goods.name='p'
    // 加新值
    goods.payfor='fukuan'
    // 打印值
    document.write(goods.price, goods.payfor)
    // 删除值
    delete goods.name
    //  打印对象
    console.log(goods)
    //调用对象方法
    goods.pay(111)
    //遍历对象
    for(let v in goods){
      console.log(v)
    }
  </script>

</body>
</html>